﻿namespace Core
{
    public enum EDialogResult
    {
        Yes,
        No,
    }

    public class MessageBoxAwaiter : IDispose
    {
        public ETTaskAwaiter Awaiter { get; private set; }
        public EDialogResult Result { get; private set; } = EDialogResult.No;

        public void CreateAwaiter()
        {
            Awaiter = new();
        }

        public void SetResult(EDialogResult result)
        {
            Result = result;
            Awaiter?.SetResult();
        }

        public virtual void Dispose()
        {
            Result = EDialogResult.No;
        }
    }
}
